using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._Package
{
    /// <summary>
    /// <para>Extract Package</para>
    /// <para>Extracts the contents of a package to a specified folder. The output folder will be  updated with the extracted contents of the input package.</para>
    /// <para>将包的内容提取到指定的文件夹。输出文件夹将使用输入包的提取内容进行更新。</para>
    /// </summary>    
    [DisplayName("Extract Package")]
    public class ExtractPackage : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public ExtractPackage()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_package">
        /// <para>Input Package</para>
        /// <para>The input package that will be extracted.</para>
        /// <para>将提取的输入包。</para>
        /// </param>
        public ExtractPackage(object _in_package)
        {
            this._in_package = _in_package;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Extract Package";

        public override string CallName => "management.ExtractPackage";

        public override List<string> AcceptEnvironments => ["workspace"];

        public override object[] ParameterInfo => [_in_package, _output_folder, _cache_package.GetGPValue(), _storage_format_type.GetGPValue(), _create_ready_to_serve_format.GetGPValue(), _target_cloud_connection];

        /// <summary>
        /// <para>Input Package</para>
        /// <para>The input package that will be extracted.</para>
        /// <para>将提取的输入包。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Package")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_package { get; set; }


        /// <summary>
        /// <para>Output Folder</para>
        /// <para><xdoc>
        ///   <para>The output folder that will contain the contents of the package.</para>
        ///   <para>If the specified folder does not exist, a folder will be created.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将包含包内容的输出文件夹。</para>
        ///   <para>如果指定的文件夹不存在，则将创建一个文件夹。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Folder")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _output_folder { get; set; } = null;


        /// <summary>
        /// <para>Cache Package</para>
        /// <para><xdoc>
        ///   <para>Specifies whether a copy of the package will be cached to your profile.</para>
        ///   <para>When extracting a package, the output is first extracted to your user profile and appended with a unique ID before a copy is made to the directory specified in the Output Folder parameter. Downloading and extracting subsequent versions of the same package will only update this location. You do not need to manually create a cached version of the package in your user profile when using this parameter. This parameter is not active if the input package is a vector tile package (.vtpk) or a tile package (.tpk and .tpkx).</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—A copy of the package will be extracted and cached to your profile. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—A copy of the package will only be extracted to the output parameter specified; it will not be cached.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否将包的副本缓存到配置文件中。</para>
        ///   <para>提取包时，首先将输出提取到用户配置文件中，并附加一个唯一 ID，然后再复制到 Output Folder 参数中指定的目录。下载并解压缩同一软件包的后续版本只会更新此位置。使用此参数时，无需在用户配置文件中手动创建包的缓存版本。如果输入包是矢量切片包 （.vtpk） 或切片包（.tpk 和 .tpkx），则此参数处于非活动状态。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 将提取包的副本并将其缓存到您的配置文件中。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 包的副本将仅提取到指定的输出参数;它不会被缓存。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Cache Package")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _cache_package_value _cache_package { get; set; } = _cache_package_value._true;

        public enum _cache_package_value
        {
            /// <summary>
            /// <para>CACHE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("CACHE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_CACHE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_CACHE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Storage Format Type</para>
        /// <para><xdoc>
        ///   <para>Specifies the storage format that will be used for the extracted cache. This parameter is applicable only when the input package is a vector tile package (.vtpk).</para>
        ///   <bulletList>
        ///     <bullet_item>Compact— The tiles will be grouped in bundle files using the Compact V2 storage format. This format provides better performance on network shares and cloud store directories. This is the default.</bullet_item><para/>
        ///     <bullet_item>Exploded— Each tile will be stored as an individual file.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将用于提取的缓存的存储格式。仅当输入包为矢量切片包 （.vtpk） 时，此参数才适用。</para>
        ///   <bulletList>
        ///     <bullet_item>Compact- 切片将使用 Compact V2 存储格式分组到包文件中。此格式在网络共享和云存储目录上提供更好的性能。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>分解 - 每个切片将存储为一个单独的文件。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Storage Format Type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _storage_format_type_value _storage_format_type { get; set; } = _storage_format_type_value._COMPACT;

        public enum _storage_format_type_value
        {
            /// <summary>
            /// <para>Compact</para>
            /// <para>Compact— The tiles will be grouped in bundle files using the Compact V2 storage format. This format provides better performance on network shares and cloud store directories. This is the default.</para>
            /// <para>Compact- 切片将使用 Compact V2 存储格式分组到包文件中。此格式在网络共享和云存储目录上提供更好的性能。这是默认设置。</para>
            /// </summary>
            [Description("Compact")]
            [GPEnumValue("COMPACT")]
            _COMPACT,

            /// <summary>
            /// <para>Exploded</para>
            /// <para>Exploded— Each tile will be stored as an individual file.</para>
            /// <para>分解 - 每个切片将存储为一个单独的文件。</para>
            /// </summary>
            [Description("Exploded")]
            [GPEnumValue("EXPLODED")]
            _EXPLODED,

        }

        /// <summary>
        /// <para>Create Ready To Serve Cache Dataset</para>
        /// <para><xdoc>
        ///   <para>Specifies whether a ready-to-serve format for ArcGIS Enterprise will be created. This parameter is active only when the input package is a vector tile package (.vtpk) or a tile package (.tpkx).</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—A folder structure with an extracted cache that can be used to create a tile layer in ArcGIS Enterprise will be created. The file extension of the folder signifies the content it stores: .tiles (cache dataset) for tile layer packages or .vtiles (vector cache dataset) for vector tile packages.</bullet_item><para/>
        ///     <bullet_item>Unchecked—A folder structure with extracted contents of the package will be created. This is the default.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否为 ArcGIS Enterprise 创建即用型格式。仅当输入包是矢量切片包 （.vtpk） 或切片包 （.tpkx） 时，此参数才处于活动状态。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 将创建具有提取缓存的文件夹结构，该缓存可用于在 ArcGIS Enterprise 中创建切片图层。文件夹的文件扩展名表示它存储的内容：.tiles（缓存数据集）用于切片图层包，.vtiles（矢量缓存数据集）用于矢量切片包。</bullet_item><para/>
        ///     <bullet_item>未选中 - 将创建包含包提取内容的文件夹结构。这是默认设置。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Create Ready To Serve Cache Dataset")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _create_ready_to_serve_format_value _create_ready_to_serve_format { get; set; } = _create_ready_to_serve_format_value._false;

        public enum _create_ready_to_serve_format_value
        {
            /// <summary>
            /// <para>READY_TO_SERVE_CACHE_DATASET</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("READY_TO_SERVE_CACHE_DATASET")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>EXTRACTED_PACKAGE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("EXTRACTED_PACKAGE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Target Cloud Connection</para>
        /// <para>The target .acs file to which the package contents will be extracted. This parameter is enabled only when the input package is a scene layer package (.slpk), a vector tile package (.vtpk), or a tile package (.tpkx).</para>
        /// <para>要将包内容提取到的目标 .acs 文件。仅当输入包为场景图层包 （.slpk）、矢量切片包 （.vtpk） 或切片包 （.tpkx） 时，才会启用此参数。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Target Cloud Connection")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _target_cloud_connection { get; set; } = null;


        public ExtractPackage SetEnv(object workspace = null)
        {
            base.SetEnv(workspace: workspace);
            return this;
        }

    }

}